import React,{FC, useEffect}from 'react';
import { login, useList } from 'src/api/user/auth';
import ClassComponent from './ClassComponent';
import FnComponent from './FnComponent';
import RequestTest from './RequestTest';
const Person:FC = (props) =>{
  // 点击保存 自动格式化代码 
  // 按照eslint 修复的
  //props.children
  // console.log(111);
  useEffect(()=>{
    async function getUserList(){
      // const res = await login({username:'admin',password:'123'});
      // console.log(res);
      // localStorage.setItem('token',res.token);
      const resPerson = await useList(4);
      console.log(resPerson);
    }
    getUserList();
  },[]);
  
  return (
    <div className="person">
      <FnComponent name={'张小三'} cId={123}>
        <h1>hahahah  我是 children</h1>
      </FnComponent>
      <ClassComponent name={'王小四'}></ClassComponent>
      <RequestTest></RequestTest>
    </div>
  );
};

export default Person;
